void CDialogProgress::OnProgressButton() 
{
	// TODO: Add your control notification handler code here
	CString temp;

	//õıе
	GetDlgItem(IDC_EDIT)->GetWindowText(temp);

	int ntemp  = atoi(temp); 
	if( (ntemp <1) || (ntemp  > 50) )  //жıеǷ趨ķΧ֮
	{
		MessageBox("ݳΧ!","Waring",MB_ICONWARNING|MB_OK);
		GetDlgItem(IDC_EDIT)->SetFocus();   //ѽı
		return;     //жϳУ
	}

	int nPercent, nTime, nCurPos = 0;

	nPercent = m_Spin.GetPos();//õSpinؼֵ
	nTime = m_Time.GetPos();//õϵǰֵ

	m_Progress.SetPos( 0 );//ýǰλΪ0
	while( (nCurPos+=nPercent) < 100 )
	{
		m_Progress.OffsetPos( nPercent );//ڽƫnPercentλ
		Sleep( 1000 * nTime / 10 );//ӳһʱ
	}
	m_Progress.SetPos( 100 );//ýǰλΪ100
}
